package io.finer.erp.jeecg.bas.service.impl;

import io.finer.erp.jeecg.bas.entity.ZrkExpress;
import io.finer.erp.jeecg.bas.entity.ZrkExpressEntry;
import io.finer.erp.jeecg.bas.mapper.ZrkExpressEntryMapper;
import io.finer.erp.jeecg.bas.mapper.ZrkExpressMapper;
import io.finer.erp.jeecg.bas.service.IZrkExpressService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;

/**
 * @Description: 商城订单物流信息表
 * @Author: jeecg-boot
 * @Date:   2020-08-27
 * @Version: V1.0
 */
@Service
public class ZrkExpressServiceImpl extends ServiceImpl<ZrkExpressMapper, ZrkExpress> implements IZrkExpressService {

	@Autowired
	private ZrkExpressMapper zrkExpressMapper;
	@Autowired
	private ZrkExpressEntryMapper zrkExpressEntryMapper;
	
	@Override
	@Transactional
	public void delMain(String id) {
		zrkExpressEntryMapper.deleteByMainId(id);
		zrkExpressMapper.deleteById(id);
	}

	@Override
	@Transactional
	public void delBatchMain(Collection<? extends Serializable> idList) {
		for(Serializable id:idList) {
			zrkExpressEntryMapper.deleteByMainId(id.toString());
			zrkExpressMapper.deleteById(id);
		}
	}
	
}
